home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wildcat Gold - The Optical BBS
/
Wildcat Gold - The Optical BBS (The Golden ROM Series)(Volume 4 Number 1)(The Digital Publishing Company)(1992).ISO
/
sdn
/
wf200_c.sdn
/
WF.011
< prev
next >
Wrap
Text File
|
1989-12-21
|
6KB
|
153 lines
.f3 - # - Chapter 11 - Calculator
.rm70
.mt5
.mb5
.pl66
.tc
.tc 11. CALCULATOR ........................................#
11. CALCULATOR
Word Fugue has a built in calculator that you can use while you are
editing. All the usual mathematical operations are available -
addition, subtraction, division, multiplication, and exponentiation.
Additional functions are natural and common logarithms, square root,
factorial, and the trigometric functions sine, cosine, tangent and
arctangent.
Several symbols (operators) are used in Word Fugue's Mathematical
equations.
Operator Function
+ addition
- subtraction
^ exponentiation (raising a number to a power)
* multiplication
/ division
div integer division
mod integer division giving remainder only
shl shift the bit pattern (4 byte integer) left
shr shift the bit pattern (4 byte integer) right
and merge 2 bit patterns so that 1 and 1 -> 1
any other combination gives zero
or merge 2 bit patterns so that if either is 1,
the result is 1
xor merge 2 bit patterns so that if either is 1,
the result is one
SQRT() square root
SQR() square
SIN() sine
COS() cosine
TAN() tangent
ATN() arctangent
LN() natural log
LOG() log base 10
FACT() factorial
EXP() e raised to the power x
PI the value of PI
TRUE the value 1 or boolean true
FALSE the value 0 or boolean false
The circle functions (SIN COS TAN ATN) all work in radians, not
degrees, so that SIN(PI) = 0, but SIN(90) = 0.893996663600558
You can use these operators in any order in any combination for almost
any calculation. Equations are limited in length to the width of the
screen. Each function can have an arbitrarily complicated equation
within its brackets.
For example
SQRT(SQR(34.5))
LOG(FACT(5)+SIN(21)*LN(1.02345296368))
You can use scientific notation to enter a long number. For example
1.23e15 represents the number 1230000000000000.000. Answers have a
maximum precision of 19 digits. If the answer is longer, Word Fugue
will give the closest answer it can, using 20 digits. The largest
number you can work with is 1.1E+4932, and the smallest is 3.4E-4932.
Overflow will cause erroneous results to display. (Word Fugue uses 20
digit reals internally)
Where there is more than one operator on a line, Word Fugue performs
the operations in a specific order - exponentiation, then
multiplication, division, then addition and subtraction. When
operators are of equal precedence, Word Fugue performs the operations
from left to right.
.CP5
You can change the order in which Word Fugue performs operations by
using parentheses to enclose operations that are to be done first. You
can enclose parentheses within parentheses for more complicated
calculations. Word Fugue always performs the operations within the
innermost set of parentheses first.
For example:
2^3+4-5/6*7 (answer 6.16666667)
2^(3+4-5)/6*7 (answer 4.66666667)
2^((3+4-5)/6*7) (answer 5.03968420)
You can also enter boolean equations for evaluation, using the
functions TRUE and FALSE. The boolean operators supported are
AND
OR
XOR
NOT
and you can put boolean equations in brackets. The result will be 1
for True and 0 for False.
For example
true xor false (answer 1.0 boolean)
1 xor 3 (answer 2.0 numeric)
10 / 3 (answer 3.333333333333333)
10 div 3 (answer 3)
10 mod 3 (answer 1 (the remainder) )
5 shl 1 (answer 10)
5 shr 1 (answer 2)
NOTE - When you use operators that are letters, you must separate them
from the values they operate on by spaces. Thus
10 mod 3 is right but 10mod3 is wrong.
.cp8
.tc Using The Pop Up Calculator ........................#
Using The Pop Up Calculator
1. Press Alt = or Ctrl J M to display the calculator window.
2. Type an equation.
3. Press Enter
You will see the result appear in the next line
4. Press ESC to return to editing, or press Enter to type in a new
equation. If you press an editing key first, you can edit the
existing equation.
.tc Copying the Last Result Into the Document ..........#
Copying the Last Result Into the Document
To copy the last result into the document you are editing press
Alt O =
or Ctrl J I =
or Alt M A (macro)
The result will appear where the cursor is positioned.
Note the next time you use the calculator in the same editing session,
you will find the last equation displayed ready for you to reenter or
edit.
.tc Copying the Equation into the Document .............#
Copying the Equation into the Document
To copy the actual equation used into the document you are editing,
type in
Alt O #
or Ctrl J I #
or Alt M E (macro)
The equation will appear at the cursor position.